import  requests
class IhrmEmpCURD(object):
    @classmethod
    def add_emp(cls, header, json_data):
        url = "http://127.0.0.1:8080/api/sys/user"
        resp = requests.post(url=url, headers=header, json=json_data)
        return resp  #添加功能

    @classmethod
    def query_emp(cls, emp_id, header):
        url = "http://127.0.0.1:8080/api/sys/user" + emp_id
        resp = requests.get(url=url, headers=header)
        return resp

    @classmethod
    def modify_emp(cls, emp_id, header,modify_data):
        url = "http://127.0.0.1:8080/api/sys/user" + emp_id
        resp = requests.put(url=url, headers=header, json=modify_data)
        return resp

    @classmethod
    def delete_emp(cls, emp_id, header):
        url = "http://127.0.0.1:8080/api/sys/user"  + emp_id
        resp = requests.delete(url=url, headers=header)
        return resp



